#pragma once

#include "Common.h"
#include <array>
#include <vector>
#include <string>

namespace GPUCC
{
	class MD5Signature
	{
	public:
		typedef MD5Hash MD5;
		typedef std::array<unsigned int, sizeof(MD5) / sizeof(unsigned int)> MD5Array;

		static std::vector<MD5Signature> ParseSignaturesFile(const std::string& File);

		MD5Signature();
		MD5Signature(const std::string Name, const unsigned int Size, const MD5& Value);
		MD5Signature(const std::string Name, const unsigned int Size, const MD5Array& Value);
		~MD5Signature();

		std::string GetName() const;
		unsigned int GetSize() const;
		const MD5& GetValue() const;
		const MD5Array& GetArrayValue() const;

	private:
		static void ConvertBufferToMD5(const std::vector<unsigned char>& Buffer, MD5& Hash);
		void MD5Signature::ConvertBufferToMD5(const std::vector<unsigned char>& Buffer, MD5Array& Hash);

		std::string m_Name;
		unsigned int m_Size;
		MD5Array m_Value;
	};
}